## API Report File for "@backstage/plugin-cost-insights"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
/// <reference types="react" />

import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePalette } from '@backstage/theme';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { BackstageTheme } from '@backstage/theme';
import { ChangeStatistic as ChangeStatistic_2 } from '@backstage/plugin-cost-insights-common';
import * as common from '@backstage/plugin-cost-insights-common';
import { Cost as Cost_2 } from '@backstage/plugin-cost-insights-common';
import { Dispatch } from 'react';
import { Entity as Entity_2 } from '@backstage/plugin-cost-insights-common';
import { ForwardRefExoticComponent } from 'react';
import { Group as Group_2 } from '@backstage/plugin-cost-insights-common';
import { JSX as JSX_2 } from 'react';
import { Maybe as Maybe_2 } from '@backstage/plugin-cost-insights-common';
import { Metric as Metric_2 } from '@backstage/plugin-cost-insights-common';
import { MetricData as MetricData_2 } from '@backstage/plugin-cost-insights-common';
import { PaletteOptions } from '@material-ui/core/styles/createPalette';
import { Product as Product_2 } from '@backstage/plugin-cost-insights-common';
import { Project as Project_2 } from '@backstage/plugin-cost-insights-common';
import { PropsWithChildren } from 'react';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { RefAttributes } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { SetStateAction } from 'react';
import { TooltipProps } from 'recharts';
import { TypographyProps } from '@material-ui/core';

// @public
export type Alert = {
  title: string | JSX.Element;
  subtitle: string | JSX.Element;
  element?: JSX.Element;
  status?: AlertStatus;
  url?: string;
  buttonText?: string;
  SnoozeForm?: Maybe_2<AlertForm>;
  AcceptForm?: Maybe_2<AlertForm>;
  DismissForm?: Maybe_2<AlertForm>;
  onSnoozed?(options: AlertOptions): Promise<Alert[]>;
  onAccepted?(options: AlertOptions): Promise<Alert[]>;
  onDismissed?(options: AlertOptions): Promise<Alert[]>;
};

// @public (undocumented)
export interface AlertCost {
  // (undocumented)
  aggregation: [number, number];
  // (undocumented)
  id: string;
}

// @public (undocumented)
export interface AlertDismissFormData {
  // (undocumented)
  feedback: Maybe_2<string>;
  // (undocumented)
  other: Maybe_2<string>;
  // (undocumented)
  reason: AlertDismissReason;
}

// @public (undocumented)
export interface AlertDismissOption {
  // (undocumented)
  label: string;
  // (undocumented)
  reason: string;
}

// @public (undocumented)
export const AlertDismissOptions: AlertDismissOption[];

// @public (undocumented)
export enum AlertDismissReason {
  // (undocumented)
  Expected = 'expected',
  // (undocumented)
  Migration = 'migration',
  // (undocumented)
  NotApplicable = 'not-applicable',
  // (undocumented)
  Other = 'other',
  // (undocumented)
  Resolved = 'resolved',
  // (undocumented)
  Seasonal = 'seasonal',
}

// @public (undocumented)
export type AlertForm<
  A extends Alert = any,
  Data = any,
> = ForwardRefExoticComponent<
  AlertFormProps<A, Data> & RefAttributes<HTMLFormElement>
>;

// @public (undocumented)
export type AlertFormProps<A extends Alert, FormData = {}> = {
  alert: A;
  onSubmit: (data: FormData) => void;
  disableSubmit: (isDisabled: boolean) => void;
};

// @public (undocumented)
export interface AlertOptions<T = any> {
  // (undocumented)
  data: T;
  // (undocumented)
  group: string;
}

// @public
export interface AlertSnoozeFormData {
  // (undocumented)
  intervals: string;
}

// @public (undocumented)
export type AlertSnoozeOption = {
  label: string;
  duration: Duration;
};

// @public (undocumented)
export const AlertSnoozeOptions: AlertSnoozeOption[];

// @public (undocumented)
export enum AlertStatus {
  // (undocumented)
  Accepted = 'accepted',
  // (undocumented)
  Dismissed = 'dismissed',
  // (undocumented)
  Snoozed = 'snoozed',
}

// @public (undocumented)
export const BarChart: (props: BarChartProps) => React_2.JSX.Element;

// @public @deprecated (undocumented)
export interface BarChartData extends BarChartOptions {}

// @public (undocumented)
export const BarChartLegend: (
  props: PropsWithChildren<BarChartLegendProps>,
) => React_2.JSX.Element;

// @public (undocumented)
export type BarChartLegendOptions = {
  previousName: string;
  previousFill: string;
  currentName: string;
  currentFill: string;
  hideMarker?: boolean;
};

// @public (undocumented)
export type BarChartLegendProps = {
  costStart: number;
  costEnd: number;
  options?: Partial<BarChartLegendOptions>;
};

// @public (undocumented)
export interface BarChartOptions {
  // (undocumented)
  currentFill: string;
  // (undocumented)
  currentName: string;
  // (undocumented)
  previousFill: string;
  // (undocumented)
  previousName: string;
}

// @public (undocumented)
export type BarChartProps = {
  resources: ResourceData[];
  responsive?: boolean;
  displayAmount?: number;
  options?: Partial<BarChartOptions>;
  tooltip?: TooltipRenderer;
  onClick?: (...args: any[]) => void;
  onMouseMove?: (...args: any[]) => void;
};

// @public (undocumented)
export const BarChartTooltip: (
  props: PropsWithChildren<BarChartTooltipProps>,
) => React_2.JSX.Element;

// @public (undocumented)
export const BarChartTooltipItem: (
  props: BarChartTooltipItemProps,
) => React_2.JSX.Element;

// @public (undocumented)
export type BarChartTooltipItemProps = {
  item: TooltipItem;
};

// @public (undocumented)
export type BarChartTooltipProps = {
  title: string;
  content?: ReactNode | string;
  subtitle?: ReactNode;
  topRight?: ReactNode;
  actions?: ReactNode;
};

// @public @deprecated (undocumented)
export type ChangeStatistic = common.ChangeStatistic;

// @public (undocumented)
export enum ChangeThreshold {
  // (undocumented)
  lower = -0.05,
  // (undocumented)
  upper = 0.05,
}

// @public (undocumented)
export type ChartData = {
  date: number;
  trend: number;
  dailyCost: number;
  [key: string]: number;
};

// @public (undocumented)
export type ConfigContextProps = {
  baseCurrency: Intl.NumberFormat;
  metrics: Metric_2[];
  products: Product_2[];
  icons: Icon[];
  engineerCost: number;
  engineerThreshold: number;
  hideTrendLine: boolean;
  currencies: Currency[];
};

// @public @deprecated (undocumented)
export type Cost = common.Cost;

// @public (undocumented)
export const CostGrowth: (props: CostGrowthProps) => React_2.JSX.Element;

// @public (undocumented)
export const CostGrowthIndicator: (
  props: CostGrowthIndicatorProps,
) => React_2.JSX.Element;

// @public (undocumented)
export type CostGrowthIndicatorProps = TypographyProps & {
  change: ChangeStatistic_2;
  formatter?: (
    change: ChangeStatistic_2,
    options?: {
      absolute: boolean;
    },
  ) => Maybe_2<string>;
};

// @public (undocumented)
export type CostGrowthProps = {
  change: ChangeStatistic_2;
  duration: Duration;
};

// @public (undocumented)
export type CostInsightsApi = {
  getLastCompleteBillingDate(): Promise<string>;
  getUserGroups(userId: string): Promise<Group_2[]>;
  getGroupProjects(group: string): Promise<Project_2[]>;
  getCatalogEntityDailyCost?(
    catalogEntityRef: string,
    intervals: string,
  ): Promise<Cost_2>;
  getGroupDailyCost(group: string, intervals: string): Promise<Cost_2>;
  getProjectDailyCost(project: string, intervals: string): Promise<Cost_2>;
  getDailyMetricData(metric: string, intervals: string): Promise<MetricData_2>;
  getProductInsights(options: ProductInsightsOptions): Promise<Entity_2>;
  getAlerts(group: string): Promise<Alert[]>;
};

// @public (undocumented)
export const costInsightsApiRef: ApiRef<CostInsightsApi>;

// @public (undocumented)
export const CostInsightsLabelDataflowInstructionsPage: () => JSX_2.Element;

// @public (undocumented)
export const CostInsightsPage: () => JSX_2.Element;

// @public (undocumented)
export type CostInsightsPalette = BackstagePalette &
  CostInsightsPaletteAdditions;

// @public (undocumented)
export type CostInsightsPaletteAdditions = {
  blue: string;
  lightBlue: string;
  darkBlue: string;
  magenta: string;
  yellow: string;
  tooltip: CostInsightsTooltipOptions;
  navigationText: string;
  alertBackground: string;
  dataViz: string[];
};

// @public (undocumented)
export type CostInsightsPaletteOptions = PaletteOptions &
  CostInsightsPaletteAdditions;

// @public (undocumented)
const costInsightsPlugin: BackstagePlugin<
  {
    root: RouteRef<undefined>;
    growthAlerts: RouteRef<undefined>;
    unlabeledDataflowAlerts: RouteRef<undefined>;
  },
  {}
>;
export { costInsightsPlugin };
export { costInsightsPlugin as plugin };

// @public (undocumented)
export const CostInsightsProjectGrowthInstructionsPage: () => JSX_2.Element;

// @public (undocumented)
export interface CostInsightsTheme extends BackstageTheme {
  // (undocumented)
  palette: CostInsightsPalette;
}

// @public (undocumented)
export interface CostInsightsThemeOptions extends PaletteOptions {
  // (undocumented)
  palette: CostInsightsPaletteOptions;
}

// @public (undocumented)
export type CostInsightsTooltipOptions = {
  background: string;
  color: string;
};

// @public (undocumented)
export interface Currency {
  // (undocumented)
  kind: string | null;
  // (undocumented)
  label: string;
  // (undocumented)
  prefix?: string;
  // (undocumented)
  rate?: number;
  // (undocumented)
  unit: string;
}

// @public (undocumented)
export type CurrencyContextProps = {
  currency: Currency;
  setCurrency: Dispatch<SetStateAction<Currency>>;
};

// @public (undocumented)
export enum CurrencyType {
  // (undocumented)
  Beers = 'BEERS',
  // (undocumented)
  CarbonOffsetTons = 'CARBON_OFFSET_TONS',
  // (undocumented)
  IceCream = 'PINTS_OF_ICE_CREAM',
  // (undocumented)
  USD = 'USD',
}

// @public (undocumented)
export enum DataKey {
  // (undocumented)
  Current = 'current',
  // (undocumented)
  Name = 'name',
  // (undocumented)
  Previous = 'previous',
}

// @public @deprecated (undocumented)
export type DateAggregation = common.DateAggregation;

// @public (undocumented)
export const DEFAULT_DATE_FORMAT = 'yyyy-LL-dd';

// @public
export enum Duration {
  // (undocumented)
  P30D = 'P30D',
  // (undocumented)
  P3M = 'P3M',
  // (undocumented)
  P7D = 'P7D',
  // (undocumented)
  P90D = 'P90D',
}

// @public (undocumented)
export const EngineerThreshold = 0.5;

// @public @deprecated (undocumented)
export type Entity = common.Entity;

// @public
export const EntityCostInsightsContent: () => JSX_2.Element;

// @public (undocumented)
export class ExampleCostInsightsClient implements CostInsightsApi {
  // (undocumented)
  getAlerts(group: string): Promise<Alert[]>;
  // (undocumented)
  getCatalogEntityDailyCost(
    entityRef: string,
    intervals: string,
  ): Promise<Cost_2>;
  // (undocumented)
  getDailyMetricData(metric: string, intervals: string): Promise<MetricData_2>;
  // (undocumented)
  getGroupDailyCost(group: string, intervals: string): Promise<Cost_2>;
  // (undocumented)
  getGroupProjects(group: string): Promise<Project_2[]>;
  // (undocumented)
  getLastCompleteBillingDate(): Promise<string>;
  // (undocumented)
  getProductInsights(options: ProductInsightsOptions): Promise<Entity_2>;
  // (undocumented)
  getProjectDailyCost(project: string, intervals: string): Promise<Cost_2>;
  // (undocumented)
  getUserGroups(userId: string): Promise<Group_2[]>;
}

// @public @deprecated (undocumented)
export type Group = common.Group;

// @public (undocumented)
export enum GrowthType {
  // (undocumented)
  Excess = 2,
  // (undocumented)
  Negligible = 0,
  // (undocumented)
  Savings = 1,
}

// @public (undocumented)
export type Icon = {
  kind: string;
  component: JSX.Element;
};

// @public (undocumented)
export enum IconType {
  // (undocumented)
  Compute = 'compute',
  // (undocumented)
  Data = 'data',
  // (undocumented)
  Database = 'database',
  // (undocumented)
  ML = 'ml',
  // (undocumented)
  Search = 'search',
  // (undocumented)
  Storage = 'storage',
}

// @public (undocumented)
export const LegendItem: (
  props: PropsWithChildren<LegendItemProps>,
) => React_2.JSX.Element;

// @public (undocumented)
export type LegendItemProps = {
  title: string;
  tooltipText?: string;
  markerColor?: string;
};

// @public (undocumented)
export type Loading = Record<string, boolean>;

// @public @deprecated (undocumented)
export type Maybe<T> = common.Maybe<T>;

// @public @deprecated (undocumented)
export type Metric = common.Metric;

// @public @deprecated (undocumented)
export type MetricData = common.MetricData;

// @public (undocumented)
export const MockConfigProvider: (
  props: MockConfigProviderProps,
) => React_2.JSX.Element;

// @public (undocumented)
export type MockConfigProviderProps = PropsWithChildren<
  Partial<ConfigContextProps>
>;

// @public (undocumented)
export const MockCurrencyProvider: (
  props: MockCurrencyProviderProps,
) => React_2.JSX.Element;

// @public (undocumented)
export type MockCurrencyProviderProps = PropsWithChildren<
  Partial<CurrencyContextProps>
>;

// @public (undocumented)
export interface PageFilters {
  // (undocumented)
  duration: Duration;
  // (undocumented)
  group: Maybe_2<string>;
  // (undocumented)
  metric: string | null;
  // (undocumented)
  project: Maybe_2<string>;
}

// @public @deprecated (undocumented)
export type Product = common.Product;

// @public (undocumented)
export type ProductFilters = Array<ProductPeriod>;

// @public (undocumented)
export type ProductInsightsOptions = {
  product: string;
  group: string;
  intervals: string;
  project: Maybe_2<string>;
};

// @public (undocumented)
export interface ProductPeriod {
  // (undocumented)
  duration: Duration;
  // (undocumented)
  productType: string;
}

// @public @deprecated (undocumented)
export type Project = common.Project;

// @public
export class ProjectGrowthAlert implements Alert {
  constructor(data: ProjectGrowthData);
  // (undocumented)
  data: ProjectGrowthData;
  // (undocumented)
  get element(): React_2.JSX.Element;
  // (undocumented)
  get subtitle(): string;
  // (undocumented)
  get title(): string;
  // (undocumented)
  get url(): string;
}

// @public (undocumented)
export interface ProjectGrowthData {
  // (undocumented)
  aggregation: [number, number];
  // (undocumented)
  change: ChangeStatistic_2;
  // (undocumented)
  periodEnd: string;
  // (undocumented)
  periodStart: string;
  // (undocumented)
  products: Array<AlertCost>;
  // (undocumented)
  project: string;
}

// @public (undocumented)
export interface ResourceData {
  // (undocumented)
  current: number;
  // (undocumented)
  name: Maybe_2<string>;
  // (undocumented)
  previous: number;
}

// @public (undocumented)
export type TooltipItem = {
  fill: string;
  label?: string;
  value?: string;
};

// @public (undocumented)
export type TooltipRenderer = (
  props: TooltipProps<string, string>,
) => ReactNode;

// @public @deprecated (undocumented)
export type Trendline = common.Trendline;

// @public
export class UnlabeledDataflowAlert implements Alert {
  constructor(data: UnlabeledDataflowData);
  // (undocumented)
  data: UnlabeledDataflowData;
  // (undocumented)
  get element(): React_2.JSX.Element;
  // (undocumented)
  status?: AlertStatus;
  // (undocumented)
  get subtitle(): string;
  // (undocumented)
  get title(): string;
  // (undocumented)
  get url(): string;
}

// @public (undocumented)
export interface UnlabeledDataflowAlertProject {
  // (undocumented)
  id: string;
  // (undocumented)
  labeledCost: number;
  // (undocumented)
  unlabeledCost: number;
}

// @public (undocumented)
export interface UnlabeledDataflowData {
  // (undocumented)
  labeledCost: number;
  // (undocumented)
  periodEnd: string;
  // (undocumented)
  periodStart: string;
  // (undocumented)
  projects: Array<UnlabeledDataflowAlertProject>;
  // (undocumented)
  unlabeledCost: number;
}
```
